<?php
/**
 * 统一侧边栏组件
 * 用于所有管理员页面的侧边栏导航
 */

// 获取当前页面名称，用于高亮显示当前菜单项
$currentPage = basename($_SERVER['PHP_SELF']);
?>
<!-- 侧边栏 -->
<div class="sidebar">
    <div class="sidebar-brand">
        <h4 class="mb-0">
            <i class="fas fa-clock me-2"></i>
            考勤系统
        </h4>
        <small>管理员面板</small>
    </div>
    
    <nav class="nav flex-column p-2">
        <a href="dashboard.php" class="nav-link <?php echo $currentPage === 'dashboard.php' ? 'active' : ''; ?>">
            <i class="fas fa-tachometer-alt"></i>
            仪表板
        </a>
        <a href="users.php" class="nav-link <?php echo $currentPage === 'users.php' ? 'active' : ''; ?>">
            <i class="fas fa-users"></i>
            用户管理
        </a>
        <a href="attendance_enhanced.php" class="nav-link <?php echo $currentPage === 'attendance_enhanced.php' ? 'active' : ''; ?>">
            <i class="fas fa-clipboard-list"></i>
            考勤记录
        </a>
        <a href="download_template.php" class="nav-link <?php echo $currentPage === 'download_template.php' ? 'active' : ''; ?>">
            <i class="fas fa-download"></i>
            下载模板
        </a>
        <a href="debug_import.php" class="nav-link <?php echo $currentPage === 'debug_import.php' ? 'active' : ''; ?>">
            <i class="fas fa-bug"></i>
            导入调试
        </a>
        <a href="reports.php" class="nav-link <?php echo $currentPage === 'reports.php' ? 'active' : ''; ?>">
            <i class="fas fa-chart-bar"></i>
            统计报表
        </a>
        <a href="config.php" class="nav-link <?php echo $currentPage === 'config.php' ? 'active' : ''; ?>">
            <i class="fas fa-cog"></i>
            系统配置
        </a>
        <div class="sidebar-footer">
            <a href="../public/logout.php" class="nav-link text-warning">
                <i class="fas fa-sign-out-alt"></i>
                退出登录
            </a>
            <div class="text-center mt-3">
                <div>版本: v2.3.0</div>
                <div>更新: 2025-10-29 15:00</div>
            </div>
        </div>
    </nav>
</div>
